package com.ylstm.controller;

import com.ylstm.service.UserService;
import com.ylstm.utils.ResultMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName UserController
 * @Description TODO
 * @date 2022/7/31 14:58
 * @Version 1.0
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    UserService userService;

    /*用户登录*/
    @RequestMapping("/login")
    public ResultMessage userLogin(String username , String password){
        ResultMessage resultMessage = userService.userLogin(username, password);
        return resultMessage;
    }
    @RequestMapping("/checkUsername")
    public ResultMessage checkUsername(String username){
        ResultMessage resultMessage = userService.checkUsername(username);
        return resultMessage;
    }
}
